package com.lt.suangua.ui.adapter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.lt.suangua.R;
import com.lt.suangua.app.AppAdapter;
import com.lt.suangua.http.api.HomeApi;
import com.lt.suangua.http.api.UserInfoApi;
import com.lt.suangua.http.glide.GlideApp;
import com.lt.widget.layout.SettingBar;

/**
 * github :
 * time   : 2018/11/05
 * desc   : 可进行拷贝的副本
 */
public final class MyItemAdapter extends AppAdapter<UserInfoApi.ItemBean> {

    public MyItemAdapter(Context context) {
        super(context);
    }

    @Override
    public int getItemCount() {
        return getCount();
    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new ViewHolder();
    }

    private final class ViewHolder extends AppAdapter<?>.ViewHolder {
        TextView tv_item;


        private ViewHolder() {

            super(R.layout.my_item);
            tv_item = findViewById(R.id.tv_item);

        }

        @Override
        public void onBindView(int position) {
            tv_item.setText(getItem(position).name);
        }

    }

}